﻿using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BrainMatch
{
    public class WaveFileObject
    {
        private List<WaveItem> m_Waves = new List<WaveItem>();
        public List<WaveItem> Waves
        {
            get
            {
                return m_Waves;
            }
            set
            {
                m_Waves = value;
            }
        }
        public WaveFileObject()
        { 
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="filepath"></param>
        public void LoadFile(string filepath)
        { 
            int param=0;
            byte[]	data=new byte[48016];
	
	//数据读取
            FileStream file=new FileStream(filepath,FileMode.Open);
            file.Read(data,0,4);
            param = BitConverter.ToInt32(data, 0);
            file.Read(data,0,48016);
            file.Close();

            m_Waves.Add(new WaveItem(3, param, data,"A"));
            m_Waves.Add(new WaveItem(4, param, data, "B"));
            m_Waves.Add(new WaveItem(13, param, data, "C"));
            m_Waves.Add(new WaveItem(14, param, data, "D"));
            m_Waves.Add(new WaveItem(9, param, data, "E"));
            m_Waves.Add(new WaveItem(10, param, data, "F"));
            

        }
    }
}
